package com.hyacinth.seckill;

import com.hyacinth.seckill.repository.CustomerJpaRepositoryFactoryBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Slf4j
@EnableTransactionManagement
@SpringBootApplication
@EnableJpaRepositories(basePackages = {"com.hyacinth.seckill.repository"}, repositoryFactoryBeanClass = CustomerJpaRepositoryFactoryBean.class) // 指定jpaRepositories位置
public class SeckillApplication {

    @Bean
    public Object testBean(PlatformTransactionManager platformTransactionManager){
        System.out.println("事务管理器>>>>>>>>>>" + platformTransactionManager.getClass().getName());
        return new Object();
    }

    public static void main(String[] args) {

        log.info("系统启动START...");
        SpringApplication.run(SeckillApplication.class, args);
        log.info("系统启动END...");
    }

}
